// Andrew Davies 2011

#if !defined( DAV_H )
#define DAV_H

#include <string>
#include <vector>

namespace Dav
{

class VertexClass
{
private:
	D3DXVECTOR4 m_position;

public:
	VertexClass( const D3DXVECTOR4& position );

	const D3DXVECTOR4& position() const
	{
		return m_position;
	}
};
	
typedef std::vector< VertexClass > VertexVectorType;

typedef std::vector< int > VertexIdxVectorType;

class FaceClass
{
private:
	VertexIdxVectorType m_vertexIdxVector;

public:
	FaceClass();

	FaceClass( const VertexIdxVectorType& vertexIdxVector );

	void addVertexIdx( const int vertexIdx );

	const VertexIdxVectorType& vertexIdxVector() const
	{
		return m_vertexIdxVector;
	}

};

typedef std::vector< FaceClass > FaceVectorType;
	
class ObjectClass
{
private:
	std::string m_name;
	bool m_infiniteMass;

	D3DXMATRIX m_transformation;

	VertexVectorType m_vertexVector;
	FaceVectorType m_faceVector;

public:
	ObjectClass(
		const std::string& name,	
		const bool infiniteMass,
		const D3DXMATRIX& transformation,
		const VertexVectorType& vertexVector,
		const FaceVectorType& faceVector );

	ObjectClass(
		const std::string& name,
		const bool infiniteMass,
		const D3DXMATRIX& transformation );
		
	const std::string& name() const
	{
		return m_name;
	}

	bool infiniteMass() const
	{
		return m_infiniteMass;
	}

	const D3DXMATRIX& transformation() const
	{
		return m_transformation;
	}

	void addVertex( const VertexClass& vertex );
	
	const VertexVectorType& vertexVector() const
	{
		return m_vertexVector;
	}

	void addFace( const FaceClass& face );

	const FaceVectorType& faceVector() const
	{
		return m_faceVector;
	}	

};

typedef std::vector< ObjectClass > ObjectVectorType;

class SceneClass
{
private:
	ObjectVectorType m_objectVector;

public:
	SceneClass();

	SceneClass( const ObjectVectorType& objectVector );

	void addObject( const ObjectClass& object );
	
	const ObjectVectorType& objectVector() const
	{
		return m_objectVector;
	}


};

}

#endif
